#ifndef __PKG_H__
#define __PKG_H__

#include <string.h>

#define	INNER_CONNECT		1
#define	OUT_CONNECT		2
#define PROCESS_TIME		3

#define LEN_PKG_HEAD 				10
#define	MAX_GW_COUNT				10
#define TYPE_GW						1
#define	COMMAND_ROOM_REGISTER		1

#define TYPE_LOBBY					10
#define	COMMAND_LOBBY_JOIN_ROOM	10
#define	COMMAND_LOBBY_LEFT_ROOM	11
#define	COMMAND_LOBBY_GET_COIN	21
#define	COMMAND_LOBBY_LEFT_ROOM_IN	22
#define	COMMAND_LOBBY_GAME_SETTLE	23

#define	COMMAND_GAME_SHOWCHAT			900
#define COMMAND_930_BEGIN			1
#define COMMAND_930_USER_JOIN		2
#define	COMMAND_930_CONTINUE		8
#define	COMMAND_930_GAME_OFFLINE	9
#define	COMMAND_930_BET			22
#define	COMMAND_930_BANKER_BET	32
#define	COMMAND_930_BANKER_OFF	31
#define COMMAND_930_CHANGE_DESK	5
#define	COMMAND_930_CHAT			33

#pragma pack(1)

typedef struct _pkg_head
{
	unsigned short 		length;
	unsigned short		type;
	unsigned short		command;
	unsigned int		uid;
	void packet(char *pOutput)
	{
		memcpy(pOutput, &length, 2);
		memcpy(pOutput+2, &type, 2);
		memcpy(pOutput+4, &command, 2);
		memcpy(pOutput+6, &uid, 4);
	}
	void unpacket(char *pInput)
	{
		memcpy(&length, pInput, 2);
		memcpy(&type, pInput+2, 2);
		memcpy(&command, pInput+4, 2);
		memcpy(&uid, pInput+6, 4);
	}
}pkg_head;

#pragma pack()

#endif

